package com.dodock.android.banglapapers.ui;

import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.MenuItem;

import com.dodock.android.banglapapers.R;

public class BaseActivity extends Activity{
	
	private final int FIRST_MENU_ID = Menu.FIRST;
	private final int SETTINGS_MENU_ITEM = FIRST_MENU_ID + 1;
	
	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		boolean result = super.onCreateOptionsMenu(menu);
		MenuItem m = menu.add(0, SETTINGS_MENU_ITEM, 0, R.string.settings);
		m.setIcon(android.R.drawable.ic_menu_preferences);		
		return result;
	}

	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		// TODO Auto-generated method stub
		boolean result = super.onOptionsItemSelected(item);		
		switch (item.getItemId()) {
		case SETTINGS_MENU_ITEM:
			settingsActivity();
			break;
		}
		return result;
	}	
	
	void  settingsActivity(){
		Intent intent = new Intent(this, SettingsActivity.class);
		startActivity(intent);
	}
}
